Skip to content

Fix per-world and per-player time#13814

Merged
kennytv merged 3 commits intomainfrom
fix/per-world-time
Apr 26, 2026
Merged

Fix per-world and per-player time#13814
kennytv merged 3 commits intomainfrom
fix/per-world-time

Conversation

@kennytv
Copy link
Copy Markdown
Member

@kennytv kennytv commented Apr 23, 2026

Makes clock managers per-world, given clocks have to be put into client-synchronized registries, which is a big no no and unnecessary block for creating worlds on the fly

Splits TimeSkipEvent into a new ClockTimeSkipEvent for when the new config option is toggled to make clocks global again. the actual clock API will be added separately. the time command succeeds even if the event is cancelled (as before?), but that didn't look like something to waste time on

Tested by creating new worlds / switching worlds with per-player time set and/or paused

@kennytv kennytv requested a review from a team as a code owner April 23, 2026 12:43
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Apr 23, 2026
Comment thread paper-server/patches/sources/net/minecraft/server/commands/TimeCommand.java.patch Outdated
Comment thread paper-api/src/main/java/org/bukkit/event/world/TimeSkipEvent.java
Comment thread paper-server/patches/sources/net/minecraft/server/level/ServerLevel.java.patch Outdated
@Doc94
Copy link
Copy Markdown
Member

Doc94 commented Apr 23, 2026

Clocks items are still broken.

2026-04-23_12-08-24.mp4

this was tested in a new world, the main world the item works.

+
+ public float partialTick(final Holder<WorldClock> definition) {
+ return this.getInstance(definition).partialTick;
+ public ClientboundSetTimePacket createFullSyncPacket(final net.minecraft.server.level.ServerPlayer player) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This need to be marked Nullable, same with packNetworkState with the null player

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lines were too long so I skipped it 🛏️

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XD

@kennytv
Copy link
Copy Markdown
Member Author

kennytv commented Apr 23, 2026

Clocks items are still broken.

2026-04-23_12-08-24.mp4
this was tested in a new world, the main world the item works.

They're hardcoded to only work in the overworld level

@masmc05
Copy link
Copy Markdown
Contributor

masmc05 commented Apr 23, 2026

A resource pack would be needed to make them work in a custom world with a custom item model definition

@kennytv kennytv added the publish-pr Enables a workflow to build Paperclip jars on the pull request. label Apr 24, 2026
@papermc-pr-publishing
Copy link
Copy Markdown

papermc-pr-publishing Bot commented Apr 24, 2026

Last updated for: 6b0abf39c04d5f34ea461255ba923ca35201ada5.

Download the Paperclip jar for this pull request: paper-13814.zip

Maven Publication

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven("https://maven-prs.papermc.io/Paper/pr13814") {
        name = "Maven for PR #13814" // https://github.com/PaperMC/Paper/pull/13814
        mavenContent {
            includeModule("io.papermc.paper", "dev-bundle")
            includeModule("io.papermc.paper", "paper-api")
        }
    }
}

@kennytv kennytv force-pushed the fix/per-world-time branch 2 times, most recently from 7500434 to 00777fd Compare April 24, 2026 17:38
Comment thread paper-api/src/main/java/org/bukkit/event/world/ClockTimeSkipEvent.java Outdated
Comment thread paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java Outdated
@kennytv kennytv force-pushed the fix/per-world-time branch from 094dd2b to 6b0abf3 Compare April 26, 2026 06:45
@kennytv kennytv merged commit a64ea13 into main Apr 26, 2026
6 checks passed
@kennytv kennytv deleted the fix/per-world-time branch April 26, 2026 11:37
@github-project-automation github-project-automation Bot moved this from Awaiting review to Merged in Paper PR Queue Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

publish-pr Enables a workflow to build Paperclip jars on the pull request.

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

/time set in other dimensions not working. Resolve todos around per-world time

6 participants